
<div class="index">
	<h2>
	<?php __('menus');?>
	</h2>

	<div class="actions">
		<?php echo $this->Html->link(__('Novo menu', true), array('action' => 'add')); ?>
	</div>
	<div class="info_table">
		<?php
	echo $this->Paginator->counter(array(
	'format' => __('Existem %count% menus cadastrados atualmente!', true)
	));
	?>
	</div>
	<table cellpadding="0" cellspacing="0" class=grande>
		<tr>
			<th width="200px"><?php echo $this->Paginator->sort("Menu", 'menu');?></th>
			<th><?php echo $this->Paginator->sort("Link", 'link');?></th>
			<th width="40px"></th>
		</tr>
		<?php
		$i = 0;
		foreach ($menus as $item):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="odd"';
		}
		?>
		<tr <?php echo $class;?>>
			<td><?php echo $item['Menu']['menu']; ?>&nbsp;</td>
			<?php if (!$item['Menu']['bloqueado']){?>
			<td><?php echo $item['Menu']['link']; ?>&nbsp;</td>
			<?php }else{?>
			<td><?php echo $item['Menu']['link']; ?>&nbsp;</td>
			<?php } ?>
			<td>
				<?php echo $this->Html->link(
					$this->Html->image('edit.png', array('alt' => 'Editar', 'title' =>'Editar'), true),
					array('action' => 'edit', $item['Menu']['id_menus']),
					array('escape' => false));
				?>
				<?php if(!$item['Menu']['bloqueado']){?>
					<?php echo $this->Html->link(
						$this->Html->image('trash.png', array('alt' => 'Apagar', 'title' => 'Apagar'), true),
						array('action' => 'delete', $item['Menu']['id_menus']),
						array('escape' => false),
						sprintf(__('Tem certeza que deseja apagar o registro %s?', true), $item['Menu']['menu'])); ?>
				<?php } ?>
			</td>
		</tr>
		<?php endforeach; ?>
	</table>
	<p>
	</p>

	<?php if ($this->Paginator->numbers()){?>
	<div class="paginacao">
	<?php echo $this->Paginator->prev('<< ' . __('Anterior', true), array(), null, array('class'=>'disabled'));?>
		|
		<?php echo $this->Paginator->numbers();?>
		|
		<?php echo $this->Paginator->next(__('Próximo', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
	<?php } ?>
</div>